//
//  XZ_ServerURLManager.m
//  Project_Demo
//
//  Created by caoxiaozhu on 2018/7/18.
//  Copyright © 2018年 caoxiaozhu. All rights reserved.
//

#import "XZ_ServerURLManager.h"

@implementation XZ_ServerURLManager

SINGLETON_FOR_CLASS(XZ_ServerURLManager);


#pragma mark - 配置文件路径
- (NSDictionary*)_config
{
    NSString *configPath = [[NSBundle mainBundle] pathForResource:@"EnvironmentConfig" ofType:@"plist"];
    NSDictionary *config = [NSDictionary dictionaryWithContentsOfFile:configPath];
    return config;
}

/**
 *  当前的环境
 *
 *  @return DEV/UAT
 */
- (NSString*)appEnv
{
    //    NSString *appEnvStr = [[self _config] objectForKey:@"Environment"];
    
    return [[self _config] objectForKey:@"Environment"];
}

/**
 *  data url
 *
 *  @return baseurl
 */
- (NSString*)serverUrl
{
    return [[[self _config] objectForKey:self.appEnv] objectForKey:@"ServerUrl"];
}

/**
 *  imgurl 头像上传
 *
 *  @return imgurl
 */
- (NSString*)imageServerUrl
{
    return [[[self _config] objectForKey:self.appEnv ] objectForKey:@"ImageUrl"] ;
}

@end
